﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Laegevagten_OUH
{
    public class Kø
    {
        
        private List<Patient> _patient;
        

        public Kø()
        {
           
           _patient = new List<Patient>();
        }

        public void nyPatient(Patient patient)
        {
            _patient.Add(patient);
  
        }

        public int Ventetid(long cpr)
        {
     
            int tid = 0;
            
            for (int i = 0; i < _patient.Count; i++)
            {


                if (_patient[i].CPR == cpr)
                {
         
                    for (int p = 0; p < _patient.Count; p++)
                    {
                        if (p < i)
                        {
                            tid = tid + _patient[p].BehandlingsTid;
                        }
                    }

                    _patient[i].VenteTid = tid;        
                }

               
             }

            return tid;
            
        }

      
        public List<Patient> PatientListe
        {
            get { return _patient; }
            set { _patient = value; }
        }

    }
}
